import pandas as pd

"""
实现功能：
    读取两个excel下sheet内容比对
"""

file_path = r'D:\01_work\01_2023\7_月\02_监考老师对比\20230704系统名单.xlsx'  # r对路径进行转义，windows需要
raw_data = pd.read_excel(file_path, header=0)  # header=0表示第一行是表头，
# 只提取表中信息
data = raw_data.values
# 二维数组转为一维,再list
first = data.flatten().tolist()

other_file_path = r'D:\01_work\01_2023\7_月\02_监考老师对比\20230630监考教师名单.xlsx'  # r对路径进行转义，windows需要
other_raw_data = pd.read_excel(other_file_path, header=0)  # header=0表示第一行是表头，
other_data = other_raw_data.values  # 只提取表中信息
# 二维数组转为一维
second = other_data.flatten().tolist()

if __name__ == '__main__':
    diff = list(set(second) - set(first))
    print(diff)
    print(len(diff))
